package de.ludo.dao;

import java.util.ArrayList;

import javax.ejb.Local;

import de.ludo.entities.Game;
import de.ludo.entities.Highscore;
import de.ludo.entities.LudoSession;
import de.ludo.entities.Player;
import de.ludo.entities.User;
import de.ludo.util.GameStatus;
import de.ludo.util.GameType;

@Local
public interface DAOLocal {

	// public User findUserById (int userId);

	public User findUserByName(String name);

	public Game findGameById(int gameId);

	public Integer findSessionIdByUserName(String name);

	public LudoSession findSessionByUserName(String username);

	public Player findPlayerById(int sessionId);

	public LudoSession findSessionById(int id);

	public Highscore findHighscoreById(int id);

	public Highscore findHighscoreByGameAndName(GameType gT, String username);

	public void saveHighscore(Highscore high);

	public void updateHighscore(Highscore high);

	public int createSession(String userName);

	public void saveUser(User user);

	public void saveGame(Game game);

	public void savePlayer(Player player);

	public void closeSession(int id);

	public void updatePlayer(Player player);

	public void updateGame(Game game);

	public void updateUser(User user);

	public ArrayList<Game> findGamesByStatus(GameStatus status);

	public void closeGame(int gameId);

	public ArrayList<Game> findAllGames();

	public void closeAllGames(ArrayList<Game> game);

	public ArrayList<LudoSession> findAllLudoSessions();

	public void closeAllLudoSessions(ArrayList<LudoSession> ludoSessions);

	public ArrayList<Highscore> getHighscoreList(GameType gameType);

	public void deletePlayer(int sessionId);
}
